#include <wx/cshelp.h>
#include "wxscontexthelpbutton.h"

namespace {
  wxsRegisterItem<wxsContextHelpButton> Reg( _T( "ContextHelpButton" ), _T( "帮助按钮" ), wxsTWidget, _T( "标准" ), 280 );
  WXS_ST_BEGIN( wxsContextHelpButtonStyles, wxT( "wxBU_AUTODRAW" ) )
  WXS_ST_CATEGORY( "wxContextHelpButton" )
  WXS_ST( wxBU_AUTODRAW )
  WXS_ST( wxBU_BOTTOM )
  WXS_ST( wxBU_LEFT )
  WXS_ST( wxBU_RIGHT )
  WXS_ST( wxBU_TOP )
  WXS_ST( wxBU_EXACTFIT )
  WXS_ST_DEFAULTS()
  WXS_ST_END()
}

wxsContextHelpButton::wxsContextHelpButton( wxsItemResData* Data ):
  wxsWidget( Data, &Reg.Info, NULL, wxsContextHelpButtonStyles ) {}

void wxsContextHelpButton::OnBuildCreatingCode() {
  switch( GetLanguage() ) {
  case wxsCPP: {
    AddHeader( _T( "<wx/cshelp.h>" ), GetInfo().ClassName, hfInPCH );
    Codef( _T( "%C(%W, wxID_CONTEXT_HELP, %P, %S, %T);\n" ) );
    BuildSetupWindowCode();
    return;
  }
  case wxsUnknownLanguage:
  default: {
    wxsCodeMarks::Unknown( _T( "wxsContextHelpButton::OnBuildCreatingCode" ), GetLanguage() );
  }
  }
}

wxObject* wxsContextHelpButton::OnBuildPreview( wxWindow* Parent, long Flags ) {
  wxContextHelpButton* Preview = new wxContextHelpButton( Parent, GetId(), Pos( Parent ), Size( Parent ), Style() );
  return SetupWindow( Preview, Flags );
}

void wxsContextHelpButton::OnEnumWidgetProperties( M_Code_unused long Flags ) {
}
